/**  

* @author renbangjie renbangjie@126.com  
* @version V1.0  
*/
package com.ai.service.reviewed.service.impl;

import java.util.Date;
import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.ai.common.core.mapper.Mapper;
import com.ai.common.core.service.impl.BaseServiceImpl;
import com.ai.mmd.reviewed.dto.JzxslinfoDTO;
import com.ai.service.reviewed.dao.JzxslinfoModelMapper;
import com.ai.service.reviewed.model.JzxslinfoModel;
import com.ai.service.reviewed.service.IJzxslinfoService;
import com.ai.service.system.dao.GkinfoModelMapper;

/**
* 
*	登陆信息的业务实现类
* 
* @author renbangjie renbangjie@126.com
*/
@Service("ijzxslinfoService")
public class JzxslinfoServiceImpl extends BaseServiceImpl<JzxslinfoModel>
		implements IJzxslinfoService {
	
	/**
	 * 编辑货运单
	 * @param JzxslinfoDTO
	 * @return
	 * @throws Exception
	 */
	public void edithyd(JzxslinfoDTO jzxslinfoDTO)throws Exception {
		
		JzxslinfoModel jzxslinfoModel = new JzxslinfoModel();
		BeanUtils.copyProperties(jzxslinfoDTO, jzxslinfoModel);
		if (jzxslinfoDTO.getId()!=null) {
			//更新
			jzxslinfoModel.setGxsj(new Date());
			jzxslinfoModelMapper.updateByPrimaryKey(jzxslinfoModel);
		}else{
			//新增
			jzxslinfoModel.setCjsj(new Date());
			jzxslinfoModel.setGxsj(new Date());
			jzxslinfoModelMapper.insert(jzxslinfoModel);
		}
	}
	
	@Resource(name = "jzxslinfoModelMapper")
	private JzxslinfoModelMapper jzxslinfoModelMapper;
	
	@Resource(name = "gkinfoModelMapper")
	private GkinfoModelMapper gkinfoModelMapper;
	
	@Override
	protected Mapper<JzxslinfoModel> getMapper() {
		return jzxslinfoModelMapper;
	}

}
